<%@ include file="/header.jsp" %>

<h1>People</h1>

<p style="margin:10px"><a href="/lab02-music-portal/music/add_person">Add Person</a></p>

<table border="1" width="90%" cellspacing="0" style="margin:10px">
<col width="5%" /><col width="40%" /><col width="45%" /><col width="10%" />
    <thead>
        <tr>
            <td><b>Id</b></td>
            <td><b>Name</b></td>
            <td><b>Surname</b></td>
            <td><b>Delete</b></td>
        </tr>
    </thead>
    <tbody>
        <c:forEach var="person" items="${list}">
            <tr>
            <td>
                <a href="/lab02-music-portal/music/add_person?id=${person.id}"> <c:out value="${person.id}"/></a>     
            </td>
            <td>
                <c:out value="${person.name}"/>
            </td>
            <td>
                <c:out value="${person.surname}"/>
            </td>
            <td>
				<c:choose>
				<c:when test="${person.updateGranted}">
				<a href="/lab02-music-portal/music/delete_person?id=${person.id}">Delete</a>
				</c:when>
				<c:otherwise>
				<p>Not allowed</p>
				</c:otherwise>
				</c:choose>               
                
            </td>
            </tr>
        </c:forEach>
    </tbody>
</table>

<%@ include file="/footer.jsp" %>
</html>
